-
Notifications
You must be signed in to change notification settings - Fork 8
Fix return type of MPIContext::get_handle #212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The get_handle() method should return an MPI_Comm and not an int, because this causes failures when building with OpenMPI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change itself looks good, I've tested it with an OpenMPI based stack and it built successfully, however one of the unit-tests fails with the following error and will need sorting out.
[ RUN ] MPINotInitTest.MpiNotInitialised
*******************/Vernier/tests/unit_tests/c++/test_mpi_not_init.cpp:20: Failure
Death test: { meto::vernier.init(); }
Result: died but not with expected exit code:
Exited with exit status 14
Actual msg:
[ DEATH ] MPIContext::init. MPI not initialized.
[ DEATH ] *** The MPI_Abort() function was called before MPI_INIT was invoked.
[ DEATH ] *** This is disallowed by the MPI standard.
[ DEATH ] *** Your MPI job will now abort.
[ DEATH ] [************] Local abort before MPI_INIT completed completed successfully, but am not able to aggregate error messages, and not able to guarantee that all other processes were killed!
[ DEATH ]
[ FAILED ] MPINotInitTest.MpiNotInitialised (2 ms)
[----------] 1 test from MPINotInitTest (2 ms total)
|
The test output is correct: Vernier does not comply with the MPI standard because it calls
MPICH is clearly willing to tolerate this but OpenMPI is not. It should be possible to resolve the problem by protecting the |
Check whether MPI is initialised before trying to call MPI_Abort. This improves compliance with the standard and prevents test failures when building with OpenMPI.
|
Clean run with OpenMPI: |
andrewcoughtrie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good change and fixes the issue. All the tests pass with OpenMPI
Description
The get_handle() method should return an MPI_Comm and not an int, because this causes failures when building with OpenMPI. This changes the prototype in the header file and the method in the source file to address the problem.
Linked issues
NA
Type of change
How has this been tested?
Prior to the fix, code would not compile with OpenMPI:
Following the change, the code now compiles successfully with OpenMPI. Change was also validated by building with MPICH.
Checklist: